package vip.xiaonuo.smzq.modular.psba.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import vip.xiaonuo.smzq.modular.psba.entity.PsbaGtDztj;
import vip.xiaonuo.smzq.modular.psba.mapper.PsbaGtDztjMapper;
import vip.xiaonuo.smzq.modular.psba.service.IPsbaGtDztjService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import vip.xiaonuo.common.page.CommonPageRequest;

import javax.annotation.Resource;
import java.util.List;

/**
 *  服务实现类
 *
 * @author sqq
 * @since 2024-05-21
 */
@Service
public class PsbaGtDztjServiceImpl extends ServiceImpl<PsbaGtDztjMapper, PsbaGtDztj> implements IPsbaGtDztjService {

    @Resource
    private PsbaGtDztjMapper psbaGtDztjMapper;

    @Override
    public Page<PsbaGtDztj> page(PsbaGtDztj psbaGtDztj) {
        QueryWrapper<PsbaGtDztj> queryWrapper = new QueryWrapper<>();
        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
    }

    @Override
    public PsbaGtDztj getPsbaGtDztj(String psbabh) {
        try{
            QueryWrapper<PsbaGtDztj> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("psbabh",psbabh);
            List<PsbaGtDztj> psbaGtDztjList = psbaGtDztjMapper.selectList(queryWrapper);
            if (psbaGtDztjList!=null&&psbaGtDztjList.size()>0){
                return psbaGtDztjList.get(0);
            }
        }catch (Exception e){

        }


        return null;
    }
}
